package tech.yunjing.train.service;


import tech.yunjing.train.entity.ReceiveRedPacketRecord;
import tech.yunjing.train.service.exception.ReceiveRedPacketRecordDeleteException;
import tech.yunjing.train.service.exception.ReceiveRedPacketRecordException;
import tech.yunjing.train.service.exception.UserAccountException;
import tech.yunjing.train.service.exception.UserLoginException;

import java.util.List;

/**
 * 红包记录Service
 * Created by zlc on 2017/6/8.
 */
public interface ReceiveRedPacketRecordService {


    /**
     * 根据指定账户逻辑删除其所有的抢红包记录
     *
     * @param userAccount
     * @return
     */
    int logicDelete(String userAccount) throws UserAccountException, ReceiveRedPacketRecordDeleteException,UserLoginException;
    ;

    /**
     * 根据用户账户查询所有的抢红包记录
     *
     * @param userAccount 用户账户
     * @return 查询结果
     */
    List<ReceiveRedPacketRecord> findByUserAccount(String userAccount) throws UserAccountException, ReceiveRedPacketRecordException,UserLoginException;

    /**
     * 将给定的红包记录集合保存至账户明细中
     * @param list 抢红包记录集合
     * @param userAccount 账户名称
     * @return 保存的明细数量
     */
    int saveAccountDetail(List<ReceiveRedPacketRecord> list, String userAccount);


}
